//https://www.nowcoder.com/practice/abc3fe2ce8e146608e868a70efebf62e?tpId=295&tqId=23256&ru=/exam/oj&qru=/ta/format-top101/question-ranking&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3D%25E7%25AE%2597%25E6%25B3%2595%25E7%25AF%2587%26topicId%3D295
#include <iostream>
#include <ostream>
class Solution {
public:
    bool Find(int target, vector<vector<int> > array) {
        if (array.empty() || array[0].empty())
        {
            return  false;
        }

        int row = 0;
        int col = array[0].size() - 1;
        while (row < array.size() && col >= 0)
        {
            if (array[row][col] < target)
            {
                ++row;
            }
            else if (array[row][col] > target)
            {
                --col;
            }
            else
            {
                return  true;
            }
        }

        return  false;
    }
};